package net.models;

// Generated 27 mars 2014 09:40:52 by Hibernate Tools 3.4.0.CR1

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Comment generated by hbm2java
 */
@Entity
@Table(name = "comment", catalog = "scrumtool")
public class Comment implements java.io.Serializable {

	private Integer id;
	private Userstory userstory;
	private Commenttype commenttype;
	private Collaborator collaborator;
	private String content;
	private Date dateComment;

	public Comment() {
	}

	public Comment(Userstory userstory, Collaborator collaborator) {
		this.userstory = userstory;
		this.collaborator = collaborator;
	}

	public Comment(Userstory userstory, Commenttype commenttype,
			Collaborator collaborator, String content, Date dateComment) {
		this.userstory = userstory;
		this.commenttype = commenttype;
		this.collaborator = collaborator;
		this.content = content;
		this.dateComment = dateComment;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "idUserStory", nullable = false)
	public Userstory getUserstory() {
		return this.userstory;
	}

	public void setUserstory(Userstory userstory) {
		this.userstory = userstory;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "idCommentType")
	public Commenttype getCommenttype() {
		return this.commenttype;
	}

	public void setCommenttype(Commenttype commenttype) {
		this.commenttype = commenttype;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "idCollaborator", nullable = false)
	public Collaborator getCollaborator() {
		return this.collaborator;
	}

	public void setCollaborator(Collaborator collaborator) {
		this.collaborator = collaborator;
	}

	@Column(name = "content", length = 65535)
	public String getContent() {
		return this.content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "dateComment", length = 19)
	public Date getDateComment() {
		return this.dateComment;
	}

	public void setDateComment(Date dateComment) {
		this.dateComment = dateComment;
	}

}
